﻿<%@ page title="" language="C#" masterpagefile="~/AdminMasterPage.master" enableeventvalidation="false" autoeventwireup="true" inherits="PL_Customer, App_Web_1zw2ahqk" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
        .auto-style6
        {
            width: 210px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div>
    
        <br />
        <table class="auto-style1">
            <tr>
                <td>
    
                    <asp:Label ID="ViewCustomerLbl" runat="server" Font-Bold="True" Font-Size="Larger" ForeColor="Blue" Text="View Customers"></asp:Label>
    
        &nbsp;&nbsp;&nbsp;
    
                    <br />
    
                    <br />
    
                </td>
            </tr>
            <tr>
                <td>
    
        <asp:GridView ID="CustomersGV" runat="server" AllowPaging="True"  OnPageIndexChanging="CustomersGV_PageIndexChanging" PageSize="5" OnSelectedIndexChanged="CustomersGV_SelectedIndexChanged" AutoGenerateColumns="False" BackColor="#CCCCCC" BorderColor="#999999" BorderStyle="Solid" BorderWidth="3px" CellPadding="4" ForeColor="Black" Height="198px" Width="515px" CellSpacing="2" OnRowDataBound="CustomersGV_RowDataBound1" OnRowEditing="CustomersGV_RowEditing">
            <Columns>

                <asp:TemplateField SortExpression="Customer Id" HeaderText="Customer Id ">
                            <HeaderStyle Font-Bold="True" ForeColor="#FFFFCC" />
                            <ItemTemplate>
                                <asp:Label ID="CustomerIdLbl" Text='<%# Eval("CustomerId") %>' Visible="true" ForeColor="#990033" runat="server" />
                                <asp:TextBox ID="CustomerIdTxtBx" Text='<%# Eval("CustomerId") %>' Visible="false" ForeColor="#990033" runat="server" />
                            </ItemTemplate>
                        </asp:TemplateField>

                 <asp:TemplateField SortExpression="Customer Name" HeaderText="Customer Name">
                            <HeaderStyle Font-Bold="True" ForeColor="#FFFFCC" />
                            <ItemTemplate>
                                <asp:Label ID="CustomerNameLbl" Text='<%# Eval("CustomerName") %>' Visible="true" ForeColor="#990033" runat="server" />
                                <asp:TextBox ID="CustomerNameTxtBx" Text='<%# Eval("CustomerName") %>' Visible="false" ForeColor="#990033" runat="server" />
                            </ItemTemplate>
                        </asp:TemplateField>

                 <asp:TemplateField SortExpression="Address" HeaderText="Address">
                            <HeaderStyle Font-Bold="True" ForeColor="#FFFFCC" />
                            <ItemTemplate>
                                <asp:Label ID="AddressLbl" Text='<%# Eval("Address") %>' Visible="true" ForeColor="#990033" runat="server" />
                                 <asp:DropDownList  ID="AddressDrpDwn" DataTextField="Address" DataValueField="AddressId" AppendDataBoundItems="True"  
                            AutoPostBack="True" Visible="false" ForeColor="#990033" runat="server" />
                            </ItemTemplate>
                        </asp:TemplateField>

                  <asp:TemplateField SortExpression="Account Id" HeaderText="Account Id">
                            <HeaderStyle Font-Bold="True" ForeColor="#FFFFCC" />
                            <ItemTemplate>
                                <asp:Label ID="AccountIdLbl" Text='<%# Eval("AccountId") %>' Visible="true" ForeColor="#990033" runat="server" />
                                
                            </ItemTemplate>
                        </asp:TemplateField>
                
              <asp:TemplateField SortExpression="Image" HeaderText="Image">
                   <HeaderStyle Font-Bold="True" ForeColor="#FFFFCC" />
                            <ItemTemplate> 
                                <asp:Image ID="Image" ImageUrl='<%# Eval("ImagePath") %>' Visible="true" runat="server" Height="100px" Width="100px"/>
                                <asp:FileUpload ID="ImageUpload" Visible="false" runat="server" />
                                <asp:Button ID="ImgPrview" Visible="false" runat="server" Text="Image Preview" Onclick="ImgPreview_Click"/>
                                
                            </ItemTemplate>
              </asp:TemplateField>
               <%-- <asp:ImageField DataImageUrlField="ImagePath" HeaderText="Picture" >

                    <ControlStyle Height="200px" Width="200px" />
                    <HeaderStyle Font-Bold="True" ForeColor="#FFFFCC" />
                    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                </asp:ImageField>--%>

                 <asp:TemplateField  HeaderText="Edit " Visible="false"> <HeaderStyle Font-Bold="True" ForeColor="#FFFFCC" />

                        <ItemTemplate>
                               <asp:Button ID="EditBtn" runat="server" CommandName="edit"  OnClick = "EditBtn_Click"  Text="Edit" > </asp:Button>
                         </ItemTemplate>

                    </asp:TemplateField>

                    <asp:TemplateField  HeaderText="Update "> <HeaderStyle Font-Bold="True" ForeColor="#FFFFCC" />

                        <ItemTemplate>
                       <asp:Button ID="UpdateBtn" runat="server" CommandName="update"  Text="Update" OnClick = "UpdateBtn_Click"></asp:Button>
                          </ItemTemplate>

                    </asp:TemplateField>

                 <asp:TemplateField  HeaderText="Delete "> <HeaderStyle Font-Bold="True" ForeColor="#FFFFCC" />

                        <ItemTemplate>
                       <asp:Button ID="DeleteBtn" runat="server" CommandName="update"  Text="Delete" OnClick = "DeleteBtn_Click"></asp:Button>
                          </ItemTemplate>

                    </asp:TemplateField>
            </Columns>
            <FooterStyle BackColor="#CCCCCC" />
            <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#CCCCCC" ForeColor="Black" HorizontalAlign="Left" />
            <RowStyle BackColor="White" />
            <SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
            <SortedAscendingCellStyle BackColor="#F1F1F1" />
            <SortedAscendingHeaderStyle BackColor="Gray" />
            <SortedDescendingCellStyle BackColor="#CAC9C9" />
            <SortedDescendingHeaderStyle BackColor="#383838" />
        </asp:GridView>
    
                </td>
            </tr>
        </table>
         
        <asp:Label ID="GridLbl" runat="server" Font-Bold="True" Font-Size="Larger" ForeColor="Red"></asp:Label>
        <br />
        <br />
        <br />
        <asp:Label ID="Note" runat="server" Font-Bold="True" Font-Size="Medium" ForeColor="Red"></asp:Label>
        <br />
    
    </div>
        <table class="auto-style1">
            <tr>
                <td colspan="7" align="center">
                    &nbsp;<br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    &nbsp;
                    <asp:Label ID="CustomersLbl" runat="server" Font-Bold="True" Font-Size="Larger" Text="Customers" ForeColor="Blue"></asp:Label>
                    <br />
                </td>
            </tr>
            <tr>
                <td colspan="7">
                    &nbsp;</td>
            </tr>
            <tr>
                <td align="left">
                    <asp:Label ID="CustomerNameLbl" runat="server" Text="Customer Name" Font-Bold="True" ForeColor="#990033"></asp:Label>
                </td>
                <td align="left" class="auto-style6" colspan="2">
                    <asp:TextBox ID="CustomerNameTxtBx" runat="server"></asp:TextBox>
                </td>
                <td> <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
                    ControlToValidate="CustomerNameTxtBx" ErrorMessage="Customer name field should not be empty"
                    ValidationGroup="b" Font-Bold="True" ForeColor="Red">*</asp:RequiredFieldValidator></td>
                <td rowspan="6" align="left">
                    <asp:Image ID="ImagePreview" runat="server" Height="129px" Width="133px" />
                </td>
                <td rowspan="6" align="left" colspan="2">
                    <asp:FileUpload ID="PhotoUpload" runat="server" />
                    
                </td>
                <td rowspan="6" align="left">
                    <asp:Button ID="btnPhotoPreview" runat="server" OnClick="btnPhotoPreview_Click" Text="Upload" />
                </td>
            </tr>
            <tr>
                <td colspan="3">
                    &nbsp;</td>
            </tr>
            <tr>
                <td align="left">
                    <asp:Label ID="AddressIdLbl" runat="server" Text="Address Id" Font-Bold="True" ForeColor="#990033"></asp:Label>
                </td>
                <td align="left" class="auto-style6" colspan="2">
                    <asp:DropDownList ID="AddDropDown" runat="server" AutoPostBack="True" DataTextField="Address" DataValueField="AddressId" Height="19px" Width="129px">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td colspan="3">
                    &nbsp;</td>
            </tr>
            <tr>
                <td align="left">
                    <asp:Label ID="AccountIdLbl" runat="server" Text="Account Id" Font-Bold="True" ForeColor="#990033"></asp:Label>
                </td>
                <td align="left" class="auto-style6" colspan="2">
                    <asp:DropDownList ID="AccDropDown" runat="server" AutoPostBack="True" DataTextField="AccountId" DataValueField="AccountId" Height="16px" Width="129px">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td colspan="3">
                    &nbsp;</td>
            </tr>
            <tr>
                <td colspan="2">
                    <asp:Button ID="AddBtn" runat="server" ValidationGroup="b" OnClick="AddBtn_Click" Text="Add" PostBackUrl="~/PL/Customer.aspx"/>
                </td>
                <td colspan="3">
                    &nbsp;</td>
                <td colspan="2">
                    &nbsp;</td>
            </tr>
            <tr>
                <td colspan="7">
                    <asp:ValidationSummary ID="ValidationSummary1" runat="server"
                        Font-Bold="True" ForeColor="Red" Height="39px" Width="318px" ValidationGroup="b" />
                </td>
            </tr>
            <tr>
                <td colspan="7">
                     <script type="text/javascript">

                         function HideLabel() {
                             document.getElementById('<%= DsplyLbl.ClientID %>').style.display = "none";
                             document.getElementById('<%= GridLbl.ClientID %>').style.display = "none";

                         }
                         setTimeout("HideLabel();", 3000);
                </script>
                    <asp:Label ID="DsplyLbl" runat="server" Font-Bold="True" Font-Size="Larger" ForeColor="Red"></asp:Label>
                </td>
            </tr>
        </table>
  </asp:Content>